#ifndef MYITEM_H
#define MYITEM_H

#include <QGraphicsItem>
#include <QOrientationSensor>
#include "database/rankdb.h"

class MyItem : public QGraphicsObject
{
    Q_OBJECT
public:
    MyItem();
    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *);

    void initParam();
    void initSpeed();
    void setSpeed(const qreal &Speed);
    qreal getMinSpeed();

protected:

#ifdef WIN32
    void keyPressEvent(QKeyEvent *event);
#endif

public slots:
    void work();

#ifdef ANDROID
    void SensorEvent();
#endif


signals:
    void sendSpeed(const qreal &Speed);
    void ending();

private:
    qreal speed;
    qreal minSpeed;
    QPixmap pix;

#ifdef ANDROID
    QOrientationSensor *sensor;
#endif

};

#endif // MYITEM_H
